package com.diandian.backend.third.exchange.controller;

import com.diandian.backend.third.exchange.dto.StoreStockDTO;
import com.diandian.backend.third.exchange.param.SkuStockQueryParam;
import com.diandian.backend.third.exchange.service.SkuStockService;
import com.diandian.base.boot.starter.response.BaseResult;
import com.diandian.base.boot.starter.util.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * Sku库存API
 */
@RestController
@RequestMapping("/sku/stock")
public class ThirdSkuStockController {

    @Autowired
    private SkuStockService skuStockService;

    /**
     * 查询SKU库存数据
     */
    @PostMapping(value = "/query")
    public BaseResult<StoreStockDTO> skuStockQuery(@RequestBody SkuStockQueryParam param) throws Exception {
        return ResultUtil.makeResult(0, "查询成功", skuStockService.querySkuStock(param));
    }

}
